
class User(object):
   def __init__(self,name,age,gender,id_number):
       self.name = name
       self.age = age
       self.gender = gender
       self.id_number = id_number

   def show_infos(self):
       print("🍎" * 20)
       print("姓名：%s" % self.name)
       print("年龄：%d" % self.age)
       print("性别：%s" % self.gender)
       print("学(工)号：%d" % self.gender)
       print("🍎" * 20)

class Student(User):
   def __init__(self,name,age,gender,id_number):
       super().__init__(name,age,gender,id_number)

   def show_infos(self):
       super().show_infos()


class Teacher(User):
   def __init__(self,name,age,gender,id_number,dao,cla):
       super().__init__(name, age, gender, id_number)
       self.dao = dao
       self.cla = cla

   def show_infos(self):
       super().show_infos()
       print("是否是导员：%s" % ['否','是'] [self.dao])
       print("辅导班级：")
       if not self.cla:
           print("空")
       else:
           for i in self.cla:
               print(i)
       print("🍎" * 20)


class Cla(object):
   def __init__(self,name,id_number,teacher,students):
      self.name = name
      self.id_number = id_number
      self.teacher = teacher
      self.students = students

   def show_infos(self):
       print("🌈" * 15 + "班级信息" + "🌈" * 15)
       print("班级名称：%s" % self.name)
       print("班级班号：%d" % self.id_number)
       print("辅导员：%s" % self.teacher.name)
       print("学生信息：")
       if not self.students:
           print("空")
       else:
           for i in self.students:
               print(i.name)
       print("🌈" * 15 + "班级信息" + "🌈" * 15)

   # 加入班级
   def add_student(self,student):
       if student in self.students:
           raise Exception("此学生已进班，不允许重复操作")
       else:
          self.students.append(student)
          return True

   # 移除班级
   def sub_student(self,student):
       if student in self.students:
         self.students.remove(student)
         return True
       else:
         raise Exception("此学生不在本班级！")



class Course(object):
      # todo
      pass

jj = Student("jj",18,"男",2025)
jay = Teacher("jay",22,"男",111,False,["计算机二班","音乐三班"])
computer_1 = Cla('计算机一班',1002,jay,[jj])
computer_1.show_infos()

